home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
yerk
/
mps231ss.hqx
/
Mops source
/
Module source
/
call1&Lmod.txt
< prev
next >
Wrap
Text File
|
1993-02-01
|
1KB
|
53 lines
\ This module handles the CallFirst and CallLast operations. Aug 91.
: 1ST&LAST 14 - ;
: CallFirst
?exec #last ?error 51
getSelect 1 ++> #1st ; immediate
: CallLast
?exec
getSelect 1 ++> #last ; immediate
: (GET) { mark \ #F #L cnt addr -- mark }
0 -> #F 0 -> #L
#1st #last + -> cnt
BEGIN cnt while >r 1 --> cnt REPEAT \ Reverse into return stk!
superM
IF superM 1- 7 btest
IF superM 1st&last -> addr addr w@ -> #F
addr 2+ w@ -> #L
THEN
THEN
\ Get 1st
#F #L + 4* --> addr
#F 0 ?DO addr @ , 4 ++> addr LOOP
#1st -> cnt
BEGIN cnt WHILE r> , 1 --> cnt REPEAT
\ Get last
#L 0 ?DO addr @ , 4 ++> addr LOOP
#last -> cnt
BEGIN cnt WHILE r> , 1 --> cnt REPEAT
#F ++> #1st #1st w, #L ++> #last #last w,
mark ;
: (C1) { \ addr -- }
#1st 0EXIT
thisM 1st&last -> addr #1st #last + 4* --> addr
#1st FOR
true -> selfRef?
addr @ ^class findm swap bind_to_self
?unHoldMod 4 ++> addr
NEXT ;
: (CL) { \ addr -- }
#last 0EXIT
thisM 1st&last -> addr
#last FOR
true -> selfRef? 4 --> addr
addr @ ^class findm swap bind_to_self
?unHoldMod
NEXT ;